<!--
 * @Author: zqx me_zqx@163.com
 * @Date: 2025-01-02 10:53:54
 * @LastEditors: zqx me_zqx@163.com
 * @LastEditTime: 2025-08-27 10:26:58
 * @FilePath: /XMate-h5/src/App.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <router-view />
</template>

<script setup>
import { onMounted, computed } from "vue";
import { setToken } from "@/utils/auth";
import { loadInfoFromPC } from "@/utils/electronTool";
import { isElectron } from "@/utils/platformTool";
import * as Sentry from "@sentry/vue";
import { useCommonStore } from "@/store/modules/common";
import { useMyXmateStore } from "@/store/modules/myXmate";
import { getToken } from "@/utils/auth";

const commonStore = useCommonStore();
const myXmateStore = useMyXmateStore();

onMounted(() => {
  window.setToken = setToken;
  window.localStorageSetItem = (key, value) => {
    localStorage.setItem(key, value);
  };

  getUserInfo();
  if (isElectron()) {
    loadInfoFromPC();
  }
});

async function getUserInfo() {
  if (!getToken()) {
    return;
  }
  commonStore.getUserInfoAction();
  myXmateStore.getCommunicationFlowsAction();
}
</script>

<style></style>
